package com.geeksaga.dao.ibatis.mysql;

import org.springframework.dao.DataAccessException;

import com.geeksaga.common.util.DateConvertor;
import com.geeksaga.dao.UserTraceDao;
import com.geeksaga.dao.ibatis.BaseIBatisDao;
import com.geeksaga.domain.Bbs;
import com.geeksaga.domain.UserTrace;

/**
 * @author newbie
 * @since 0.1
 */
public class UserTraceDaoImpl extends BaseIBatisDao implements UserTraceDao {

	/* (non-Javadoc)
	 * @see com.geeksaga.dao.UserTraceDao#add(com.geeksaga.domain.UserTrace)
	 */
	public UserTrace add(UserTrace userTrace) throws DataAccessException {
		userTrace.setRegistDate(DateConvertor.getDateFormat());
		userTrace.setRegistTime(DateConvertor.getTimeFormat());
		userTrace.setRegistTimestamp(DateConvertor.getDateTimeFormat());
		
		return (UserTrace) getSqlMapClientTemplate().insert("USER_TRACE.add", userTrace);
	}

	/* (non-Javadoc)
	 * @see com.geeksaga.dao.UserTraceDao#find(com.geeksaga.domain.Bbs)
	 */
	public UserTrace find(Bbs bbs) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}
}